package pl.leader100.rest.data;

import java.util.UUID;

import javax.xml.bind.annotation.XmlRootElement;


@XmlRootElement
public class Doc {

	private int iddocument;
	//private String role;
	private String title;
	private String path;
	private String locale;
	private String mimetype;
	private String course;
	private String classe;
	private String category;
	
	private int month;
	private Boolean parent;
	private Boolean student;
	private Boolean coach;
	private Boolean tutor;
	private Boolean teacher;
	private Boolean director;
	
	private UUID uniqueKey;

	public Doc() {
		super();
	}
	
	public Doc(String title, String path, String locale, String course, String category,
			String mimetype) {
		super();
		//this.role = role;
		this.title = title;
		this.path = path;
		this.locale = locale;
		this.course = course;
		this.category = category;
		this.setMimetype(mimetype);
	}
	public Doc(int id, String title, String path, String locale, String course, String category,
			String mimetype) {
		super();
		this.iddocument = id;
		this.title = title;
		this.path = path;
		this.locale = locale;
		this.course = course;
		this.category = category;
		this.setMimetype(mimetype);
	}
	
	public Doc(int iddocument, String title, String path, String locale, String course, String category,
			int month, boolean parent, boolean student, boolean coach, boolean tutor, boolean teacher, boolean director) {
		super();
		this.iddocument = iddocument;
		this.title = title;
		this.path = path;
		this.locale = locale;
		this.course = course;
		this.category = category;
		this.setMimetype(mimetype);
		this.month=month;
		this.parent=parent;
		this.student=student;
		this.coach=coach;
		this.tutor=tutor;
		this.teacher=teacher;
		this.director=director;
	}
	
	public Boolean getRoleValue(String role) {
		if (role.equals("parent"))
			return getParent();
		else if (role.equals("student"))
			return getStudent();
		else if (role.equals("coach"))
			return getCoach();
		else if (role.equals("tutor"))
			return getTutor();
		else if (role.equals("teacher"))
			return getTeacher();
		else if (role.equals("director"))
			return getDirector();
		else
			return false;
	}
	public boolean getRole(String role) {
		if ("parent".equals(role))
			return getParent();
		if ("student".equals(role))
			return getStudent();
		
		if ("coach".equals(role))
			return getCoach();
		if ("tutor".equals(role))
			return getTutor();
		if ("teacher".equals(role))
			return getTeacher();
		if ("director".equals(role))
			return getDirector();
				
		return false;
	}

	/**
	 * compare only the booleans (roles)
	 * @param s
	 * @return
	 */
	public boolean equalsRoles(Doc s) {
		boolean e = true;
		if (s.getParent()!=parent)
			e=false;
		if (s.getStudent()!=student)
			e=false;
		if (s.getCoach()!=coach)
			e=false;
		if (s.getTutor()!=tutor)
			e=false;
		if (s.getTeacher()!=teacher)
			e=false;
		if (s.getDirector()!=director)
			e=false;
		return e;
	}
	// ///////////////////////////////////////
	public int getId() {
		return iddocument;
	}
	
	public void setId(int id) {
		this.iddocument = id;
	}

	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}


	public String getLocale() {
		return locale;
	}

	public void setLocale(String locale) {
		this.locale = locale;
	}
	
	public void setMimetype(String mimetype) {
		this.mimetype = mimetype;
	}

	public String getMimetype() {
		return mimetype;
	}

	public void setCourse(String course) {
		this.course = course;
	}

	public String getCourse() {
		return course;
	}

	public void setUniqueKey(UUID uniqueKey) {
		this.uniqueKey = uniqueKey;
		
	}
	public UUID getUniqueKey() {
		return uniqueKey;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCategory() {
		return category;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	public int getMonth() {
		return month;
	}

	public void setClasse(String classe) {
		this.classe = classe;
	}

	public String getClasse() {
		return classe;
	}

	public void setParent(Boolean parent) {
		this.parent = parent;
	}

	public Boolean getParent() {
		return parent;
	}

	public void setStudent(Boolean student) {
		this.student = student;
	}

	public Boolean getStudent() {
		return student;
	}

	public void setCoach(Boolean coach) {
		this.coach = coach;
	}

	public Boolean getCoach() {
		return coach;
	}

	public void setTutor(Boolean tutor) {
		this.tutor = tutor;
	}

	public Boolean getTutor() {
		return tutor;
	}

	public void setTeacher(Boolean teacher) {
		this.teacher = teacher;
	}

	public Boolean getTeacher() {
		return teacher;
	}

	public void setDirector(Boolean director) {
		this.director = director;
	}

	public Boolean getDirector() {
		return director;
	}

	public void setIddocument(int iddocument) {
		this.iddocument = iddocument;
	}

	public int getIddocument() {
		return iddocument;
	}

}
